from django.conf.urls import url

from . import views

app_name = 'seisnet'
urlpatterns = [
    url(r'^$', views.NetworkListView.as_view(), name='index'),
    url(r'^add/$', views.NetworkCreateView.as_view(), name='add'),
    url(r'^ajax/detele/$', views.network_delete, name='delete'),
    url(r'^station/add/$', views.StationCreateView.as_view(), name='station_add'),
    url(r'^(?P<code>\w+)/$', views.NetworkDetailView.as_view(), name='network'),
    url(r'^(?P<code>\w+)/edit/$', views.NetworkUpdateView.as_view(), name='edit'),
    url(r'^(?P<network_code>\w+)/station/$', views.StationListView.as_view(), name='station_list'),
    url(r'^(?P<network_code>\w+)/station/add/', views.StationCreateView.as_view(), name='station_add_with_network'),
    url(r'^(?P<network_code>\w+)/station/(?P<code>\w+)/$', views.StationDetailView.as_view(), name='station_detail'),
    url(r'^(?P<network_code>\w+)/station/(?P<code>\w+)/edit/$', views.StationUpdateView.as_view(), name='station_edit'),
]
